.codebox-wrapper {
  min-width: 600px;

  &:last-child {
    margin-bottom: 48px;
  }

  .demo {
    margin-top: 24px;
    padding: 48px;
    color: #282f38;
    background-color: var(--color-bg-2);
    border: 1px solid var(--color-border);
    border-radius: 2px 2px 0 0;
  }

  .arco-code-wrapper,
  .arco-code-wrapper-css {
    position: relative;

    .arco-code-operations {
      display: flex;
      justify-content: flex-end;
      padding-top: 12px;
      overflow: hidden;

      .arco-btn {
        margin-left: 8px;

        .arco-icon {
          pointer-events: none;
        }

        &:nth-child(2) svg {
          vertical-align: -3px;
        }
      }
    }

    pre.code_block {
      position: relative;
      width: 100%;
      background-color: var(--color-fill-1);
      font-size: 14px;
      margin: 0;
      border: 0;

      .language-js {
        padding: 28px 48px;
        box-sizing: border-box;
      }

      .language-css {
        padding: 16px 48px;
        box-sizing: border-box;
      }

      > code {
        font-size: 13px;
        padding: 0;
        width: 100%;
        overflow-x: auto;
        display: block;
      }
    }

    .content-code-design {
      position: relative;
      overflow: hidden;

      &.show-all {
        margin-top: 16px;
      }
    }
  }

  .arco-code-wrapper-css {
    border-top: 1px solid var(--color-border);
    display: none;
    overflow: hidden;
  }

  // markdown
  .code-preview {
    code {
      font-size: 85%;
      padding: 2px 8px;
      margin: 0 2px;
      border-radius: 2px;
      color: var(--color-text-2);
    }

    pre > code {
      background: transparent;
      border: 0;
      font-size: 100%;
      margin: 0;
      padding: 0;
      white-space: pre;
      word-break: normal;
    }

    p,
    li {
      line-height: 1.8;
    }
  }

  .code > .code-preview {
    height: 0;
    overflow: hidden;
  }

  .show-all .code > .code-preview {
    height: unset;
  }

  .show-all .code .arco-code-wrapper-css {
    display: block;
  }

  .show-all .code .arco-code-wrapper-short {
    display: none;
  }
}

// operation button
.arco-code-operations {
  .arco-btn-secondary:not(.arco-btn-disabled) {
    background-color: var(--color-bg-4);
    border: 1px solid var(--color-fill-3);

    &:hover {
      background-color: transparent;
      border: 1px solid rgb(var(--primary-6));
      color: rgb(var(--primary-6));
    }
  }

  .ac-btn-expanded {
    background-color: rgb(var(--gray-10)) !important;
    color: rgb(var(--gray-1)) !important;
    border-color: rgb(var(--gray-1)) !important;
  }
}

body:not([arco-theme='dark']) {
  .arco-code-operations {
    .arco-btn-secondary:not(.arco-btn-disabled).arco-btn-shape-round {
      background-color: rgb(var(--gray-10));
      border: 1px solid rgb(var(--gray-10));
      color: #fff;
    }
  }
}

.ac-demo-title {
  &:hover {
    a {
      opacity: 1;
    }
  }

  a {
    opacity: 0;
    margin-left: -24px;
    padding-right: 4px;

    &:hover svg {
      color: rgb(var(--primary-6));
    }

    svg {
      width: 1em;
      height: 1em;
      font-size: 18px;
      color: var(--color-text-3);
      vertical-align: -2px;
    }
  }
}

.ac-description {
  display: flex;
  align-items: flex-end;

  &-children {
    flex: 1;
  }

  &-expand-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
  }
}
